package com.fatan.demo

import androidx.lifecycle.ViewModel
import com.hjq.permissions.XXPermissions
import ohos.ace.plugin.taskmanagerplugin.JavaTaskImpl

class DemoViewModel : ViewModel() {
    private val taskImpl by lazy { JavaTaskImpl(BaseApplication.INSTANCE) }

    private var taskId = -1L

    fun create() {
        taskId = taskImpl.create(requestJson)
    }

    fun start() {
        taskImpl.start(taskId)
    }
}